package com.example.deertrip;

import android.content.Intent;
import android.os.Bundle;
import android.view.animation.Animation;
import android.view.animation.AnimationUtils;
import android.widget.ImageView;
import android.widget.TextView;

import androidx.appcompat.app.AppCompatActivity;

import java.util.Timer;
import java.util.TimerTask;

public class WelcomeActivity extends AppCompatActivity {
    ImageView iv;
    TextView tv;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_welcome);
        iv=findViewById(R.id.iv_welcome);
        tv=findViewById(R.id.tv_welcome);

        Animation animiv= AnimationUtils.loadAnimation(this, R.anim.imgappear);
        Animation animtv= AnimationUtils.loadAnimation(this,R.anim.textappear);

        iv.startAnimation(animiv);
        tv.startAnimation(animtv);

        Timer timer = new Timer();
        TimerTask timerTask = new TimerTask() {
            @Override
            public void run() {

                Intent intent = new Intent(WelcomeActivity.this,MainActivity.class);
                startActivity(intent);

                WelcomeActivity.this.finish();
            }
        };

        timer.schedule(timerTask,4500);


    }
}